﻿using HCQ2_IDAL;
using HCQ2_Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HCQ2_DAL_MSSQL
{
    public partial class T_UserRoleRelationDAL: IT_UserRoleRelationDAL
    {
        /// <summary>
        ///  获取用户分配角色集合
        /// </summary>
        /// <param name="userid"></param>
        /// <returns></returns>
        public List<T_UserRoleRelation> GetUserRoleList(string userid)
        {
            sb?.Clear();
            sb.Append($"SELECT * FROM dbo.T_UserRoleRelation WHERE USER_ID IN({userid})");
            DataTable dt = HCQ2_Common.SQL.SqlHelper.ExecuteDataTable(sb.ToString());
            return HCQ2_Common.Data.DataTableHelper.DataTableToIList<T_UserRoleRelation>(dt);
        }
    }
}